package com.dao;

import com.dto.BookDTO;
import com.dto.BookResponsibilityDTO;
import com.po.BookPO;
import com.po.BookResponsibilityPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author linyukun
 * @date 2022/7/5 19:08
 */
@Mapper
@Repository
public interface BookDao {
    List<BookPO> getBookListByTypeId(@Param("typeId") long typeId);

    List<BookPO> getBookList(@Param("dto")BookDTO dto);

    Long addBook(@Param("dto") BookDTO dto);

    Long editBook(@Param("dto")BookDTO dto);

    BookPO getBookById(@Param("dto")BookDTO dto);

    void addBookResponsibility(@Param("dto")List<BookResponsibilityDTO> mainResponsibilitys);

    void deleteBookResponsibilityById(Long bookId);

    List<BookResponsibilityPO> getBookResponsibilityListByBookIdAndIsMain(@Param("bookId") Long id, @Param("isMain") int isMain);

    List<BookPO> getBookByIsbn(@Param("isbn")String isbn);

    Integer delteBookById(@Param("dto") BookDTO bookDTO);

    List<String> reptileList();

    void delteBookStockByBookId(@Param("dto") BookDTO bookDTO);

    void deleteBookRecommendByBookId(@Param("dto") BookDTO bookDTO);
}
